package com.interview.ujiuye5;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;

public class MyClient2 {

	public static void main(String[] args) throws Exception {
		Socket socket = new Socket("localhost",8080);

		OutputStream outputStream = socket.getOutputStream();
		PrintWriter pw = new PrintWriter(outputStream,true);
		pw.println("加班学习.....");

		InputStream inputStream = socket.getInputStream();
		InputStreamReader  isr = new InputStreamReader(inputStream);
		char cbuf[] = new char[1024];
		int len = isr.read(cbuf);
		System.out.println("服务器说:"+new String(cbuf,0,len));
		
		pw.close();
		socket.close();
	}
}